if (!stmts)
goto error;
- ctxt->stylesheet->statements = stmts;
- stmts = NULL;
+ ctxt->stylesheet->statements = g_steal_pointer (&stmts);
ctxt->cur_stmt = NULL;
return;
}
return;
}
- ctxt->stylesheet->statements = stmt2;
- stmt2 = NULL;
+ ctxt->stylesheet->statements = g_steal_pointer (&stmt2);
}
static void
ctxt->cur_stmt);
if (stmt) {
- ctxt->stylesheet->statements = stmt;
- stmt = NULL;
+ ctxt->stylesheet->statements = g_steal_pointer (&stmt);
ctxt->cur_stmt = NULL;
}
ctxt->cur_media_stmt = NULL;
}
- ctxt->stylesheet->statements = stmts;
- stmts = NULL;
+ ctxt->stylesheet->statements = g_steal_pointer (&stmts);
ctxt->cur_stmt = NULL ;
ctxt->cur_media_stmt = NULL ;
stmt2 = cr_statement_append (ctxt->cur_stmt, stmt);
if (!stmt2)
goto error;
- ctxt->cur_stmt = stmt2;
- stmt2 = NULL;
+ ctxt->cur_stmt = g_steal_pointer (&stmt2);
stmt = NULL;
} else {
stmt2 = cr_statement_append (ctxt->stylesheet->statements,
stmt);
if (!stmt2)
goto error;
- ctxt->stylesheet->statements = stmt2;
- stmt2 = NULL;
+ ctxt->stylesheet->statements = g_steal_pointer (&stmt2);
stmt = NULL;
}
ENSURE_PARSING_COND (status == CR_OK
&& token && token->type == IDENT_TK);
- result->name = token->u.str;
- token->u.str = NULL;
+ result->name = g_steal_pointer (&token->u.str);
cr_token_destroy (token);
token = NULL;
ENSURE_PARSING_COND (status == CR_OK && token);
if (token->type == IDENT_TK) {
- result->value = token->u.str;
- token->u.str = NULL;
+ result->value = g_steal_pointer (&token->u.str);
} else if (token->type == STRING_TK) {
- result->value = token->u.str;
- token->u.str = NULL;
+ result->value = g_steal_pointer (&token->u.str);
} else {
status = CR_PARSING_ERROR;
goto error;
add_sel = cr_additional_sel_new_with_type
(ID_ADD_SELECTOR);
- add_sel->content.id_name = token->u.str;
- token->u.str = NULL;
+ add_sel->content.id_name = g_steal_pointer (&token->u.str);
cr_parsing_location_copy
(&add_sel->location,
add_sel = cr_additional_sel_new_with_type
(CLASS_ADD_SELECTOR);
- add_sel->content.class_name = token->u.str;
- token->u.str = NULL;
+ add_sel->content.class_name = g_steal_pointer (&token->u.str);
add_sel_list =
cr_additional_sel_append
if (token->type == IDENT_TK) {
pseudo->type = IDENT_PSEUDO;
- pseudo->name = token->u.str;
- token->u.str = NULL;
+ pseudo->name = g_steal_pointer (&token->u.str);
found_sel = TRUE;
} else if (token->type == FUNCTION_TK) {
- pseudo->name = token->u.str;
- token->u.str = NULL;
+ pseudo->name = g_steal_pointer (&token->u.str);
cr_parser_try_to_skip_spaces_and_comments
(a_this);
status = cr_parser_parse_ident
if (status == CR_OK && found_sel == TRUE) {
cr_parser_try_to_skip_spaces_and_comments (a_this);
- sel->add_sel = add_sel_list;
- add_sel_list = NULL;
+ sel->add_sel = g_steal_pointer (&add_sel_list);
if (*a_sel == NULL) {
*a_sel = sel;
goto error;
if (token && token->type == FUNCTION_TK) {
- *a_func_name = token->u.str;
- token->u.str = NULL;
+ *a_func_name = g_steal_pointer (&token->u.str);
} else {
status = CR_PARSING_ERROR;
goto error;
cr_term_append_term (*a_expr, expr);
expr = NULL;
} else {
- *a_expr = expr;
- expr = NULL;
+ *a_expr = g_steal_pointer (&expr);
}
cr_parser_clear_errors (a_this);
ENSURE_PARSING_COND (status == CR_OK
&& token && token->type == IDENT_TK);
- medium = token->u.str;
- token->u.str = NULL;
+ medium = g_steal_pointer (&token->u.str);
cr_token_destroy (token);
token = NULL;
ENSURE_PARSING_COND (status == CR_OK && token);
if (token->type == IDENT_TK) {
- page_selector = token->u.str;
- token->u.str = NULL;
+ page_selector = g_steal_pointer (&token->u.str);
cr_token_destroy (token);
token = NULL;
} else {
status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr, &token);
ENSURE_PARSING_COND (status == CR_OK
&& token && token->type == STRING_TK);
- charset_str = token->u.str;
- token->u.str = NULL;
+ charset_str = g_steal_pointer (&token->u.str);
cr_token_destroy (token);
token = NULL;
cr_token_destroy (token);
token = NULL;
- if (charset_str) {
- *a_value = charset_str;
- charset_str = NULL;
- }
+ *a_value = g_steal_pointer (&charset_str);
PRIVATE (a_this)->state = CHARSET_PARSED_STATE;
return CR_OK;